package com.pri.chat.adapter;

import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.netease.nim.uikit.net.entity.DetailListBean;
import com.netease.nim.uikit.net.entity.InviteBean;
import com.pri.chat.R;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * 描述：添加类的描述
 *
 * @author wx5e48d604c2885118
 * @time 2020/4/24
 */
public class InviteAdapter extends BaseQuickAdapter<InviteBean, BaseViewHolder> {
    public InviteAdapter(int layoutResId, @Nullable List<InviteBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, InviteBean item) {
        helper.setText(R.id.yqrName,"邀请"+item.getByqrName());
        helper.setText(R.id.yqrTime,item.getAddDate());
        TextView tv_info = helper.getView(R.id.tv_info);
        TextView tv_money = helper.getView(R.id.tv_money);
        if(!"完成新手任务".equals(item.getInfo())){
            tv_info.setText(item.getInfo());
            tv_info.setVisibility(View.VISIBLE);
            tv_money.setVisibility(View.GONE);
        }else{
            tv_info.setVisibility(View.GONE);
            tv_money.setVisibility(View.VISIBLE);
            tv_money.setText("+"+item.getSyMoney()+"元");
        }
    }
}
